package cn.gson.fengboot.controller;

import cn.gson.fengboot.model.pojos.Lshenpi;
import cn.gson.fengboot.model.pojos.Ltousu;
import cn.gson.fengboot.model.pojos.Lxsfy;
import cn.gson.fengboot.model.service.LshenpiService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/vue")
public class LshenpiController {
    @Autowired
    LshenpiService lshenpiService;


    @RequestMapping("/selectsp")
    @ResponseBody
    public Map<String,Object> selectsp(String vv,String spr){
        List<Lshenpi> lshenpis = lshenpiService.selectsp(vv,spr);
        Map<String,Object> map =new LinkedHashMap<>();
        map.put("lshenpis",lshenpis);
        return map;
    }


    //修改审批
    @RequestMapping("/xgsp")
    @ResponseBody
    public  void xiugaisp(String spzt,Integer empid,String date,String spid){
        lshenpiService.xgsp(spzt,empid,date,spid);
    }

    //修改销售费用审批
    @RequestMapping("/xgxsfy")
    @ResponseBody
    public  void xgxsfy(String spzt,Integer xsfyid){
        lshenpiService.xgxsfy(spzt,xsfyid);
    }

    //修改销售费用审批
    @RequestMapping("/xgchucha")
    @ResponseBody
    public  void xgchucha(String spzt,Integer ccid){
        lshenpiService.xgchucha(spzt,ccid);
    }

    //修改销售费用审批
    @RequestMapping("/xghuanhuo")
    @ResponseBody
    public  void xghuanhuo(String spzt,Integer huamhuoid){
        System.err.println("huamhuoid"+huamhuoid);
        lshenpiService.xghuanhuo(spzt,huamhuoid);
    }

    //修改销售费用审批
    @RequestMapping("/xgtuihuo")
    @ResponseBody
    public  void xgtuihuo(String spzt,Integer tuihuoid){
        lshenpiService.xgtuihuo(spzt,tuihuoid);
    }

    //修改销售费用审批
    @RequestMapping("/xgcaigou")
    @ResponseBody
    public  void xgcaigou(String spzt,Integer caigouid){
        lshenpiService.xgcaigou(spzt,caigouid);
    }

    //修改销售费用审批
    @RequestMapping("/xgdoffer")
    @ResponseBody
    public  void xgdoffer(String spzt,Integer baojiaid,Integer ygid){
        System.err.println("12s"+spzt);
        lshenpiService.xgdoffer(spzt,baojiaid);
    }


}
